import 'package:flutter/material.dart';
import '../info/index.dart';
import '../../../widgets/common_swipper.dart';
import '../../../widgets/search_bar/index.dart';
import 'index_navigator.dart';
import 'index_recommend.dart';

class TabIndex extends StatelessWidget {
  const TabIndex({ Key key }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: SearchBar(
          defaultInputValue: '请输入搜索词', 
          shwoLocation: true,
          showMap: true,
          onSearch: (){
            Navigator.of(context).pushNamed('search');
          },
        ),
        backgroundColor: Colors.white,
      ),
      body: ListView(
        children: [
          CommonSwipper(),
          IndexNavigator(),
          IndexRecommend(),
          Info(showTitle: true,)
        ],
      ),
    );
  }
}